﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace RealNumbersValidator
{
    class RealNumberValidator
    {
        static void check(string number)
        {
            string pattern = @"\A(
                            (0)| 
                            (-?([1-9][0-9]*((\.)[0-9]+)?))|
                            (0(\.)[0-9]+)| 
                            (-0(\.)[0-9]*[1-9]+[0-9]*)
                             )\Z";
            Match match = Regex.Match(number, pattern,RegexOptions.IgnorePatternWhitespace);
            if (match.Success) 
            {
                Console.WriteLine("valid");
            }
            else
                Console.WriteLine("invalid number");
        
        }
        static void Main(string[] args)
        {
            
            check("0");
            check("0.0");
            check("0.5");
            check("-0.5");
            check("1.55");
            check("1");
            check("150");
            check("-30");
            check("-1.55");
            check("-0");
            check("-0.0"); 
            check("+5");
            check("5.");
            check("2-3");
            check("0 5");
            check("..25");
            check("5..56");
            check("5.5.5");
            check("1.5e7");
            check("-.5");
            check(".5");
            check("-00.5");
            check("00.25");
            }        
            
    }
}
